package com.saw96x.MyBlog.service;

import com.saw96x.MyBlog.dao.UserRepository;
import com.saw96x.MyBlog.pojo.User;
import com.saw96x.MyBlog.utils.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.security.provider.MD5;

/**
 * @author Saw96x
 * @date 20/11/05 - 19:56
 */

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        return userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
    }
}













